package com.dxysun.design.state;

public class Context
{
    private IState state;

    public Context()
    {
        setState(new ConcreteStateA());
    }

    public void setState(IState state)
    {
        this.state = state;
    }

    public void handle()
    {
        setState(state.handle());
    }

    public void transferToA()
    {
        setState(new ConcreteStateA());
    }

    public void transferToB()
    {
        setState(new ConcreteStateB());
    }
}
